<?php
include "config.php";
$objDB = new pgsql();
$objTDB = new pgsql("trace");


$sql	= "SELECT * FROM member";
$objDB->query($sql);
$res1	= $objDB->fetch();

for($i = 0, $cnt = count($res1);$i<$cnt;$i++) {
	$sql1 = "INSERT into member (usertype, userno, username, fbauthkey, rdate) VALUES('"
	. $res1[$i]['logtype'] . "', '"
	. $res1[$i]['lognum'] . "', '"
	. $res1[$i]['name'] . "', '"
	. $res1[$i]['fbauthkey'] . "', '"
	. $res1[$i]['rdate'] . "')";

	if($objTDB->query($sql1)) {
		echo "success ";
	} else {
		echo "fail ";
	}
}
//AAAC8ODyCwqoBAOFd5aN685p3696aOfOZBURr3YZCGHyBXn36BC4yLjveEyGCXCJIoHrn4is7Rn5Ie1e8xhBrNzAsy6X2kZD
?>
